<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tvs_sdk_api: tvs_authorize.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">tvs_sdk_api
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('tvs__authorize_8h_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">tvs_authorize.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="tvs__authorize_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#ifndef __TVS_AUTHORIZE_H_FHUIEWRT__</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#define __TVS_AUTHORIZE_H_FHUIEWRT__</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="tvs__common__def_8h.html">tvs_common_def.h</a>&quot;</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="keywordtype">int</span> <a class="code" href="tvs__authorize_8h.html#abfb19a7d5e4978dfa171f930ff139e01">tvs_authorize_init</a>(<a class="code" href="tvs__common__def_8h.html#a90dcf7653d61ef8ba1925005dccf71ac">tvs_authorize_callback</a> callback);</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="keywordtype">int</span> <a class="code" href="tvs__authorize_8h.html#ad9475048d0cc32dd3f3922da4cec99e2">tvs_authorize_set_auth_info</a>(<span class="keywordtype">char</span>* auth_info, <span class="keywordtype">int</span> auth_info_len);</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="keywordtype">int</span> <a class="code" href="tvs__authorize_8h.html#ae2277f513c6d870a34228dea9c75b452">tvs_authorize_set_client_id</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* client_id);</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="keywordtype">int</span> <a class="code" href="tvs__authorize_8h.html#a78e92f317cb166dc370d4602230d0d8b">tvs_authorize_clear_auth_info</a>();</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="keywordtype">char</span>* <a class="code" href="tvs__authorize_8h.html#ab3d983509ada888b6f9decfc44e81756">tvs_authorize_generate_client_id</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* product_id, <span class="keyword">const</span> <span class="keywordtype">char</span>* dsn);</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="keywordtype">int</span> <a class="code" href="tvs__authorize_8h.html#a95965cda6cfb912bb97689aa0d93b224">tvs_authorize_start</a>();</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="keywordtype">int</span> <a class="code" href="tvs__authorize_8h.html#a59b9d9b9ffd1abd0ff1a1e8a252919c8">tvs_authorize_restart</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* client_id);</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="keywordtype">int</span> <a class="code" href="tvs__authorize_8h.html#acd689c7d25c161eef027586ec044b5ff">tvs_authorize_manager_initalize</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* product_id, <span class="keyword">const</span> <span class="keywordtype">char</span>* dsn, <span class="keyword">const</span> <span class="keywordtype">char</span>* authorize_info, <span class="keywordtype">int</span> authorize_info_size, <a class="code" href="tvs__common__def_8h.html#a90dcf7653d61ef8ba1925005dccf71ac">tvs_authorize_callback</a> auth_callback);</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="keywordtype">int</span> <a class="code" href="tvs__authorize_8h.html#aa17c3a3839b5379d692c7714f7531c33">tvs_authorize_manager_guest_login</a>();</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="keywordtype">int</span> <a class="code" href="tvs__authorize_8h.html#ac9490a9b0cc94d9ead7dbacb9e9f01f1">tvs_authorize_manager_set_client_id</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* client_id);</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="keywordtype">int</span> <a class="code" href="tvs__authorize_8h.html#ab90c953dc34cf02e532445f3ea758b63">tvs_authorize_manager_login</a>();</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<span class="keywordtype">int</span> <a class="code" href="tvs__authorize_8h.html#a7049ed176d81b8cd8803ff9579ef0acd">tvs_authorize_manager_logout</a>();</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="tvs__authorize_8h_html_a7049ed176d81b8cd8803ff9579ef0acd"><div class="ttname"><a href="tvs__authorize_8h.html#a7049ed176d81b8cd8803ff9579ef0acd">tvs_authorize_manager_logout</a></div><div class="ttdeci">int tvs_authorize_manager_logout()</div><div class="ttdoc">注销，用于重新授权的流程，调用此函数清除之前授权的信息</div></div>
<div class="ttc" id="tvs__authorize_8h_html_ab90c953dc34cf02e532445f3ea758b63"><div class="ttname"><a href="tvs__authorize_8h.html#ab90c953dc34cf02e532445f3ea758b63">tvs_authorize_manager_login</a></div><div class="ttdeci">int tvs_authorize_manager_login()</div><div class="ttdoc">触发设备授权流程</div></div>
<div class="ttc" id="tvs__authorize_8h_html_abfb19a7d5e4978dfa171f930ff139e01"><div class="ttname"><a href="tvs__authorize_8h.html#abfb19a7d5e4978dfa171f930ff139e01">tvs_authorize_init</a></div><div class="ttdeci">int tvs_authorize_init(tvs_authorize_callback callback)</div><div class="ttdoc">初始化authorize模块，已过时；</div></div>
<div class="ttc" id="tvs__authorize_8h_html_a59b9d9b9ffd1abd0ff1a1e8a252919c8"><div class="ttname"><a href="tvs__authorize_8h.html#a59b9d9b9ffd1abd0ff1a1e8a252919c8">tvs_authorize_restart</a></div><div class="ttdeci">int tvs_authorize_restart(const char *client_id)</div><div class="ttdoc">使用新的client id，重新授权；已过时；</div></div>
<div class="ttc" id="tvs__authorize_8h_html_ad9475048d0cc32dd3f3922da4cec99e2"><div class="ttname"><a href="tvs__authorize_8h.html#ad9475048d0cc32dd3f3922da4cec99e2">tvs_authorize_set_auth_info</a></div><div class="ttdeci">int tvs_authorize_set_auth_info(char *auth_info, int auth_info_len)</div><div class="ttdoc">设置之前生成的authorize结果，调用这个函数代表之前已经完成授权，仅仅需要对授权结果进行刷新操作；已过时；</div></div>
<div class="ttc" id="tvs__authorize_8h_html_ac9490a9b0cc94d9ead7dbacb9e9f01f1"><div class="ttname"><a href="tvs__authorize_8h.html#ac9490a9b0cc94d9ead7dbacb9e9f01f1">tvs_authorize_manager_set_client_id</a></div><div class="ttdeci">int tvs_authorize_manager_set_client_id(const char *client_id)</div><div class="ttdoc">在设备授权方案中，从手机APP端同步client id到设备端后，需要调用此函数设置client id;</div></div>
<div class="ttc" id="tvs__common__def_8h_html"><div class="ttname"><a href="tvs__common__def_8h.html">tvs_common_def.h</a></div><div class="ttdoc">TVS SDK结构体和参数、返回值、错误码等定义</div></div>
<div class="ttc" id="tvs__authorize_8h_html_aa17c3a3839b5379d692c7714f7531c33"><div class="ttname"><a href="tvs__authorize_8h.html#aa17c3a3839b5379d692c7714f7531c33">tvs_authorize_manager_guest_login</a></div><div class="ttdeci">int tvs_authorize_manager_guest_login()</div><div class="ttdoc">触发访客授权流程</div></div>
<div class="ttc" id="tvs__authorize_8h_html_a78e92f317cb166dc370d4602230d0d8b"><div class="ttname"><a href="tvs__authorize_8h.html#a78e92f317cb166dc370d4602230d0d8b">tvs_authorize_clear_auth_info</a></div><div class="ttdeci">int tvs_authorize_clear_auth_info()</div><div class="ttdoc">清除authorize info，一般用于重新配对流程；已过时；</div></div>
<div class="ttc" id="tvs__authorize_8h_html_acd689c7d25c161eef027586ec044b5ff"><div class="ttname"><a href="tvs__authorize_8h.html#acd689c7d25c161eef027586ec044b5ff">tvs_authorize_manager_initalize</a></div><div class="ttdeci">int tvs_authorize_manager_initalize(const char *product_id, const char *dsn, const char *authorize_info, int authorize_info_size, tvs_authorize_callback auth_callback)</div><div class="ttdoc">授权模块初始化</div></div>
<div class="ttc" id="tvs__authorize_8h_html_a95965cda6cfb912bb97689aa0d93b224"><div class="ttname"><a href="tvs__authorize_8h.html#a95965cda6cfb912bb97689aa0d93b224">tvs_authorize_start</a></div><div class="ttdeci">int tvs_authorize_start()</div><div class="ttdoc">启动authorize流程；已过时；</div></div>
<div class="ttc" id="tvs__authorize_8h_html_ae2277f513c6d870a34228dea9c75b452"><div class="ttname"><a href="tvs__authorize_8h.html#ae2277f513c6d870a34228dea9c75b452">tvs_authorize_set_client_id</a></div><div class="ttdeci">int tvs_authorize_set_client_id(const char *client_id)</div><div class="ttdoc">设置新的client id，调用此函数将清除之前的authorize结果，之后将利用新的client id重新执行authorize操作；已过时；</div></div>
<div class="ttc" id="tvs__authorize_8h_html_ab3d983509ada888b6f9decfc44e81756"><div class="ttname"><a href="tvs__authorize_8h.html#ab3d983509ada888b6f9decfc44e81756">tvs_authorize_generate_client_id</a></div><div class="ttdeci">char * tvs_authorize_generate_client_id(const char *product_id, const char *dsn)</div><div class="ttdoc">无账号方案中，利用product id和dsn组合client id；已过时；</div></div>
<div class="ttc" id="tvs__common__def_8h_html_a90dcf7653d61ef8ba1925005dccf71ac"><div class="ttname"><a href="tvs__common__def_8h.html#a90dcf7653d61ef8ba1925005dccf71ac">tvs_authorize_callback</a></div><div class="ttdeci">void(* tvs_authorize_callback)(bool ok, char *auth_info, int auth_info_len, const char *client_id, int error)</div><div class="ttdoc">监听authorize的结果，需要持久化此结果，作为下一次authorize的依据</div><div class="ttdef"><b>Definition:</b> tvs_common_def.h:258</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="tvs__authorize_8h.html">tvs_authorize.h</a></li>
    <li class="footer">制作者
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>
